#include<iostream>
using namespace std;
class Node2D {
protected:
	string location;
public:
	Node2D(string _location) {
		location = _location;
	}
};
class Body :public Node2D {
protected:
	int maxHealth;
	int health;
	int defense;
public:
	Body(string _location, int _maxHealth, int _defense) :Node2D(_location) {
		maxHealth = health = _maxHealth;
		defense = _defense;
	}
};
class Weapon :public Node2D {
protected:
	string w_name;
	int damage;
public:
	Weapon(string _location, string _w_name, int _damage) :Node2D(_location) {
		w_name = _w_name;
		damage = _damage;
	}
};
class Player :virtual public Body, virtual public Weapon {
protected:
	string name;
public:
	Player(string _location, string _name, int _maxHealth, int _defense, string _w_name, int _damage) :Body(_location, _maxHealth, _defense), Weapon(_location, _w_name, _damage) {
		name = _name;
	}
	int get_health() {
		return health;
	}
	void attack(Player& p) {
		int s = damage - p.defense;

		if (s > 0) {
			cout << name << " deal " << s << " damage to " << p.name << endl;
			if (p.health > s) {
				p.health -= s;
				cout << p.name << " still have " << p.health << " health" << endl;
				cout << endl;
			}
			else {
				p.health -= s;
				cout << name << " defeated " << p.name << " by " << w_name << " in " << Weapon::location << endl;
			}
		}
	}
};
int main()
{
	string location;
	cin >> location;
	string name;
	int maxHealth;
	int defense;
	string w_name;
	int damage;
	cin >> name >> maxHealth >> defense >> w_name >> damage;
	Player p1(location, name, maxHealth, defense, w_name, damage);
	cin >> name >> maxHealth >> defense >> w_name >> damage;
	Player p2(location, name, maxHealth, defense, w_name, damage);
	while (p1.get_health() > 0 && p2.get_health() > 0) {
		p1.attack(p2);
		if (p2.get_health() <= 0) {
			break;
		}
		p2.attack(p1);
	}
	return 0;
	return 0;
}